<?php

  function tvn_register_insert_data($table, $data = array()) {
    return db_insert($table)->fields($data)->execute();
  }

  function tvn_register_email_exists($email) {
    return (bool) db_select('users', 'u')->fields('u', array('uid'))->condition('u.mail', $email)->execute()->fetchField();
  }